package com.songlanyun.modules.config.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.songlanyun.common.utils.BeanUtil;
import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.common.utils.Query;
import com.songlanyun.modules.config.dao.YxtTeamRewardConfigDao;
import com.songlanyun.modules.config.dao.YxtUserTeamRateConfigDao;
import com.songlanyun.modules.config.entity.YxtTeamRewardConfig;
import com.songlanyun.modules.config.entity.YxtUserTeamRateConfig;
import com.songlanyun.modules.config.service.otherStoreManagerRewardConfigService;
import com.songlanyun.modules.integralconfig.dao.IntegralConfigDao;
import com.songlanyun.modules.integralconfig.entity.IntegralConfig;
import com.songlanyun.modules.integralconfig.service.IntegralConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("otherStoreManagerRewardConfigService")
public class otherStoreManagerRewardConfigServiceImpl extends ServiceImpl<YxtTeamRewardConfigDao, YxtTeamRewardConfig> implements otherStoreManagerRewardConfigService {

    @Autowired
    private YxtUserTeamRateConfigDao yxtUserTeamRateConfigDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<YxtTeamRewardConfig> page = this.page(
                new Query<YxtTeamRewardConfig>().getPage(params),
                new QueryWrapper<YxtTeamRewardConfig>()
        );

        return new PageUtils(page);
    }

    @Override
    public void saveOtherStoreManagerRewardConfig(YxtUserTeamRateConfig yxtUserTeamRateConfig) {
        if (yxtUserTeamRateConfig.getId() != null) {
            yxtUserTeamRateConfigDao.updateById(yxtUserTeamRateConfig);
        }
    }

    @Override
    public List<YxtUserTeamRateConfig> get() {
        return yxtUserTeamRateConfigDao.selectList(new LambdaQueryWrapper<YxtUserTeamRateConfig>());
    }


}
